<h3><B>奖励类型</B></h3>
<br>
<a ng-click="addVoucherType()" class="btn-primary btn-sm nodecoration">添加奖励类型</a>
<br>
<br>
<div class="tab-content">
    <div class="tab-pane active" id="tab_a">
        <table class="table table-condensed">
            <thead>
            <tr>
                <th>id</th>
                <th>名称</th>
                <th>价值</th>
                <th>类型</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="type in voucherType">
                <td>{{type.id}}</td>
                <td>{{type.voucher_name}}</td>
                <td>{{type.voucher_val}}</td>
                <td><span ng-show="type.type == 1">代金券</span><span ng-show="type.type == 2">情值</span></td>
            </tr>
            </tbody>
        </table>
    </div>
</div>

<div class="modal fade" id="voucher_model" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span></button>
                <h5 class="modal-title" id="myModalLabel">添加代金券类型</h5>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" name="backendUserForm">
                    <div class="form-group">
                        <label for="inputLoginId" class="control-label col-xs-2">名称:</label>

                        <div class="col-xs-3">
                            <input type="text" class="form-control" ng-model="voucher.voucher_name" id="loginId"
                                   required>
                        </div>
                    </div>
                    <div id="d_value" class="form-group">
                        <label for="inputUserName" class="control-label col-xs-2">价值:</label>

                        <div class="col-xs-3">
                            <input type="text" class="form-control" ng-model="voucher.voucher_val" id="userName"
                                   required>
                            <span style="color: #a94442">{{valueErrMsg}}</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-2" for="role">类型:</label>

                        <div class="col-xs-2">
                            <select ng-model="voucher.type" class="form-control"
                                    ng-options="m.value as m.name for m in type" required>
                                <option value="">-- 请选择 --</option>
                            </select>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button id="saveButton" type="submit" class="btn btn-default" ng-click="saveVoucher(voucher)">
                            保存
                        </button>
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>